<?php

// src/Mcm/UserBundle/Entity/User.php

namespace Mcm\UserBundle\Entity;

use Mcm\RepasBundle\Entity\AbstractGMapEntity;
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser {

    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(name="sexe", type="string", length=1)
     */
    protected $sexe;

    /**
     * @ORM\Column(name="age", type="integer")
     */
    protected $age;

    /**
     * @ORM\Column(name="adresse", type="string", length=255)
     */
    protected $adresse;

    /**
     * @ORM\Column(name="ville", type="string", length=255)
     */
    protected $ville;

    /**
     * @ORM\Column(name="codep", type="string", length=5)
     */
    protected $codeP;

    /**
     * @ORM\Column(name="nom", type="string", length=255)
     */
    protected $nom;

    /**
     * @ORM\Column(name="prenom", type="string", length=255)
     */
    protected $prenom;

    /**
     * @ORM\OneToMany(targetEntity="Mcm\RepasBundle\Entity\Repas", mappedBy="hote")
     */
    private $repashotes;

    /**
     * @ORM\OneToMany(targetEntity="Mcm\RepasBundle\Entity\Bon", mappedBy="hote")
     */
    private $Bons;

    /**
     * @var float
     *
     * @ORM\Column(name="acompte", type="float")
     */
    private $acompte;

    public function getAcompte() {
        return $this->acompte;
    }

    public function addAcompte($a) {
        $this->acompte = $this->acompte + $a;
    }

    public function setAcompte($acompte) {
        $this->acompte = $acompte;
    }

    public function addBon(\Mcm\RepasBundle\Entity\Bon $bon) {
        $this->Bons[] = $bon;
        return $this;
    }

    public function removeBon(\Mcm\RepasBundle\Entity\Bon $bon) {
        $this->Bons->removeElement($bon);
        $bon->setHote($this);
    }

    public function getRepashote() {
        return $this->repashotes;
    }

    public function addRepashote(\Mcm\RepasBundle\Entity\Repas $repas) {
        $this->repashotes[] = $repas;
        return $this;
    }

    public function removeRepashote(\Mcm\RepasBundle\Entity\Repas $repas) {
        $this->repashotes->removeElement($repas);
        $repas->setHote($this);
    }
    /**
     * Set sexe
     *
     * @param string $sexe
     */
    public function setSexe($sexe) {
        $this->sexe = $sexe;
    }

    /**
     * Get sexe
     *
     * @return string 
     */
    public function getSexe() {
        return $this->sexe;
    }

    /**
     * Set age
     *
     * @param integer $age
     */
    public function setAge($age) {
        $this->age = $age;
    }

    /**
     * Get age
     *
     * @return integer 
     */
    public function getAge() {
        return $this->age;
    }

    /**
     * Set adresse
     *
     * @param string $sexe
     */
    public function setAdresse($adresse) {
        $this->adresse = $adresse;
    }

    /**
     * Get adresse
     *
     * @return string 
     */
    public function getAdresse() {
        return $this->adresse;
    }

    /**
     * Set ville
     *
     * @param string $ville
     */
    public function setVille($ville) {
        $this->ville = $ville;
    }

    /**
     * Get ville
     *
     * @return string 
     */
    public function getVille() {
        return $this->ville;
    }

    /**
     * Set codeP
     *
     * @param string $codeP
     */
    public function setCodeP($codeP) {
        $this->codeP = $codeP;
    }

    /**
     * Get codeP
     *
     * @return string 
     */
    public function getCodeP() {
        return $this->codeP;
    }

    /**
     * Set nom
     *
     * @param string $nom
     */
    public function setNom($nom) {
        $this->nom = $nom;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom() {
        return $this->nom;
    }

    /**
     * Set prenom
     *
     * @param string $prenom
     */
    public function setPrenom($prenom) {
        $this->prenom = $prenom;
    }

    /**
     * Get prenom
     *
     * @return string 
     */
    public function getPrenom() {
        return $this->prenom;
    }

    public function __construct() {
        parent::__construct();
        $this->sexe = "f";
        $this->ville = "";
        $this->codeP = "";
        $this->nom = "";
        $this->prenom = "";
        $this->age = 1;
        $this->acompte = 0;
    }

    public function getId() {
        return $this->id;
    }

}
